<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
  <title>Bcomposer <%= ('- '+ @project.name) if (@project) %></title>
  <%= stylesheet_link_tag 'admin' %>
  <%= javascript_include_tag :fckeditor %>
  <%= javascript_include_tag :defaults %>
  <%= javascript_tag <<EOF_SCRIPT
    function show_spinner( element ) {
        var spinner = new Image();
        //var spinner = document.createElement('img');
        spinner.src = 'spinner.gif';
        spinner.border = 0;
        element.appendChild( spinner );
    }
EOF_SCRIPT
%>

</head>
<body>

<div id="header">
	<% if current_user %>
	<div id="logoutbox">
	  <%= current_user.name %> | 
	  <%= link_to _('Logout'), {:controller => '/admin/user', :action => 'logout', :project_name => nil}, :confirm => _('Are you sure you want to logout?') %>
      <% if (current_user.is_admin?) %>
		<%= (' | '+link_to(_('Projects'), {:controller => '/admin/projects', :action => 'list', :project_name => nil}))  %>
		<%= (' | '+link_to(_('Templates'), {:controller => '/admin/templets', :action => 'list', :project_name => nil}))  %>
		<%= (' | '+link_to(_('Users'), {:controller => '/admin/users', :action => 'list', :project_name => nil}))  %>
		<%= (' | '+link_to(_('Recipients'), {:controller => '/admin/recipients', :action => 'list', :project_name => nil}))  %>
      <% elsif (current_user.projects.count > 1) %>
        <%= (' | '+link_to(_('Projects'), {:controller => '/admin/projects', :action => 'list', :project_name => nil}))  %>
      <% end %>
	</div>
	<% end %>
	<h1><%= image_tag("logo.png", :border=>0) %> <%= ('- ' + link_to(@project.name, {:controller => 'bulletins', :action => 'list'})) if (@project) %></h1>
</div>

<% if @skip_admin_flash.blank? %>
<div id="flash">
  <p style="color: green"><%= flash[:notice] %></p>
  <p style="color: red"><%= flash[:warning] %></p>
  <p style="color: red"><%= flash[:error] %></p>
</div>
<% end %>

<div id="content">

  <%= yield %>

</div>



</body>
</html>
